/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
  \file			viewimpl.h
  \date			Dec 2012
  \author		TNick

  \brief		Contains the definition for ViewImpl class


*//*


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Please read COPYING and README files in root folder
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef __VIEWIMPL_INC__
#define __VIEWIMPL_INC__
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

#include	<memtrack.h>
#include	<cpg/actions/editorbase.h>
#include	<QObject>
#include	<ui_view.h>


/*  INCLUDES    ============================================================ */
//
//
//
//
/*  CLASS    --------------------------------------------------------------- */

class	ActionsHost;
class	QMenu;
class	QToolBar;

/**
*	@brief	allows the customisation of the apparence
*
*	Style sheets are another implementation of a
*	<a href="http://doc.qt.nokia.com/latest/stylesheet.html">Qt feature</a>
*	that allows the customisation of "the apparence of widgets
*	in addition to what is already possible by subclassing
*	<a href="http://doc.qt.nokia.com/latest/qstyle.html">QStyle</a>
*	(partially exposed in the \ref ui_templates "User interface templates").
*
*	Styles sheets are textual specifications that can be set by browsing and
*	loading a file by the user or by choosing a file already present
*	in the plug-ins folder.
*
*	To understand the concepts and implementation of the style sheets,
*	please read <a href="http://doc.qt.nokia.com/latest/stylesheet.html">
*	Qt specification</a>.
*
*	... encapsulates the look and feel of a GUI...
*
*	The class exposes a feature of Qt implemented mainly by the
*	<a href="http://doc.qt.nokia.com/latest/qstyle.html">QStyle</a> class.
*	This class "encapsulates the look and feel of a GUI", such as
*	Windows, Mac, Motif. While the implementation in Qt allows for
*	plug-in like use, this implementation using MW_UiTempl does not
*	exposes this to the user. Instead, it will present a list of "templates"
*	that underlying library reports are available.
*
*	The user can choose a menu entry and, as a result, the entire interface
*	is updated, showing choosen templated applied over existing controls.
*	The command line switch \b style is not implemented and wil not work.
*/

class ViewImpl		: public QObject, public MemTrack	{
	Q_OBJECT
	BBM_TRACK( ViewImpl )

	//
	//
	//
	//
	/*  DEFINITIONS    ----------------------------------------------------- */

	/*  DEFINITIONS    ===================================================== */
	//
	//
	//
	//
	/*  DATA    ------------------------------------------------------------ */

private:

	/**
	*	@brief
	*/
	Ui::View			ui_;


	/**
	*	@brief	the host
	*/
	ActionsHost *		host_;


	/**
	*	@brief	the menu with stylesheets
	*/
	QMenu *				sty_mnu_;


	/**
	*	@brief	the menu with ui templates
	*/
	QMenu *				uitpl_mnu_;



	/*  DATA    ============================================================ */
	//
	//
	//
	//
	/*  FUNCTIONS    ------------------------------------------------------- */

public:


	/**
	*	@brief	constructor;
	*/
	ViewImpl			( QObject * parent = NULL );


	/**
	*	@brief	destructor;
	*/
	virtual				~ViewImpl		( void );


	/**
	*	@brief	initialisation
	*/
	bool				init			( ActionsHost * host );


	/**
	*	@brief	termination
	*/
	void				end				( void );


	/**
	*	@brief	inserts the actions in the menu
	*/
	void				initMenu			( QMenu * menu );


public slots:


	/**
	*	@brief	removes the color decoration that may have been previously loaded
	*/
	void    slot_No_skin            ( void );


	/**
	*	@brief	loads color decoration from a file (the user needs to browse)
	*/
	void    slot_LoadStySh          ( void );


	/**
	*	@brief	change the color scheme of the GUI
	*/
	void    slot_SkinChange         (QAction* p_active);


	/**
	*	@brief	change the template for the GUI
	*/
	void    slot_UItplChange        (QAction* p_active);


	/**
	*	@brief	change the direction of the layout
	*/
	void	slot_LayDir				( void );


	/**
	*	@brief	Decreases the zoom for active document
	*/
	void	slot_ZoomOut			( void );


	/**
	*	@brief	Increases the zoom for active document
	*/
	void	slot_ZoomIn				( void );


	/**
	*	@brief	Allows changing the zoom value directly
	*/
	void	slot_ZoomSet			( void );


	/**
	*	@brief	fired when the current editor changes
	*/
	void	activeEditorChanged		( EditorBase * ed );


private slots:


	/**
	*	@brief	Allows changing the language
	*/
	void	changeLanguage			( void );


private:


	/**
	*	@brief	actual loading for style sheets
	*/
	void    _loadStySh              (QString fileName);


	/**
	*	@brief	adds a menu entry for a language
	*/
	bool	addLang					(
			const QString &			s_lang,
			const QString &			locale
			);


	/*  FUNCTIONS    ======================================================= */
	//
	//
	//
	//

};	/*	class ViewImpl	*/

/*  CLASS    =============================================================== */
//
//
//
//
#endif // __VIEWIMPL_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
